package cn.kgc.service.impl;

import cn.kgc.mapper.JobInfMapper;
import cn.kgc.pojo.JobInf;
import cn.kgc.service.JobService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("jobService")
public class JobServiceimpl implements JobService {

    @Resource
    JobInfMapper jobInfMapper;

    @Override
    public int getCount(String NAME) {
        return jobInfMapper.getCount(NAME);
    }

    @Override
    public List<JobInf> getJobByPage(Integer cruuentPageNo, Integer pageSize, String NAME) {
        Integer pageNo = (cruuentPageNo-1)*pageSize;
        return jobInfMapper.getJobByPage(pageNo,pageSize,NAME);
    }

    @Override
    public JobInf getJobById(Integer id) {
        return jobInfMapper.getJobById(id);
    }

    @Override
    public boolean updateJob(JobInf jobInf) {
        int count = jobInfMapper.updateJob(jobInf);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public boolean addJob(JobInf jobInf) {
        int count = jobInfMapper.addJob(jobInf);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public boolean delId(Integer id) {
        int count = jobInfMapper.delId(id);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public JobInf getJobNAME(String NAME) {
        return jobInfMapper.getJobNAME(NAME);
    }

    @Override
    public List<JobInf> getJobInfo() {
        return jobInfMapper.getJobInfo();
    }
}
